package com.hengfoxwolf.jetpackdemo.ui.dashboard
import android.os.Bundle
import android.view.View
import androidx.lifecycle.ViewModelProvider
import com.hengfoxwolf.jetpackdemo.base.BaseFragment
import com.hengfoxwolf.jetpackdemo.databinding.FragmentDashboardBinding

class DashboardFragment : BaseFragment<FragmentDashboardBinding>(FragmentDashboardBinding::inflate) {

    private lateinit var dashboardViewModel: DashboardViewModel

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {

        super.onViewCreated(view, savedInstanceState)
        dashboardViewModel = ViewModelProvider(this)[DashboardViewModel::class.java]

        //通过message代理mBinding.textDashboard
        //var message by mBinding.textDashboard

        //lifecycle绑定实现了DefaultLifecycleObserver的Chronometer
        lifecycle.addObserver(mBinding.chronometer)
    }

}